package com.hkb.josephusproblemlib;

public class IsHuiWen {
    private static class Node {
        private int data;
        private Node next;

        public Node(int data) {
            this.data = data;
        }
    }

    public static void main(String[] args) {

        String str = "asdfghjkllkjhgfdsa";
        System.out.println("是否为回文串"+ isHasHuiWen(str));
    }

    public static boolean isHasHuiWen(String str) {
        char[] chars = str.toCharArray();
        char[] temp = new char[chars.length];
        int index = 0;
        for (int i = chars.length - 1; i >= 0; i--) {
            temp[index] = chars[i];
            index++;
        }
        return new String(temp).equals(str);
    }
}
